//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace Microsoft.Research.ScientificWorkflow
{
	/// <summary>
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App : Application
	{
        /// <summary>
        /// Application Entry Point.
        /// </summary>
        [System.STAThreadAttribute()]
        public static void Main()
        {
            SplashScreen splashScreen = new SplashScreen(@"Embedded\Images\composer.png");
            splashScreen.Show(false);

            App app = new App();
            app.InitializeComponent();
            splashScreen.Close(TimeSpan.FromSeconds(1));
            app.Run();
        }

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            if (e.Args.Length == 1)
            {
                this.Properties.Add("newWorkflow", true);
            }

            else if(e.Args.Length == 2)
            {
                string guid = e.Args[1];
                this.Properties.Add("workflowId", guid); 
            }
        }
    }
}
